import requests

url = 'https://webapi.blizzard.cn/hs-cards-api-server/api/web/cards/constructed'
headers = {
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36',
    'referer': 'https://hs.blizzard.cn/',

}
json = {
    "page": 1, "page_size": 200,
}

response = requests.post(url, headers=headers, json=json)
for item in response.json().get('data')['list']:
    print(item['name'],item['image'])
    if item['name'] and item['image']:
        response=requests.get(item['image'])
        with open(f'../static/炉石传说/{item['name']}.png', 'wb') as f:
            f.write(response.content)
